package com.changcheng.project.yuminsi.controller;

import com.changcheng.framework.aspectj.LogPointcut;
import com.changcheng.project.yuminsi.service.NewEtcAfterSaleService;
import com.changcheng.project.yuminsi.vo.BaseOutput;
import com.changcheng.project.yuminsi.vo.CheckReportRequest;
import com.changcheng.project.yuminsi.vo.UpgradeRecordRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yuminsi
 * @description
 * @date 2020/11/10 15:17
 * @since
 */
@Api(description = "新增etc售后接口")
@RestController
@RequestMapping("/etcAfterSale")
public class NewEtcAfterSaleController {

    @Autowired
    private NewEtcAfterSaleService newEtcAfterSaleService;

    @ApiOperation(value = "OBU固件升级记录同步", notes = "OBU固件升级记录同步")
    @LogPointcut(description = "OBU固件升级记录同步")
    @PostMapping("/upgradeRecordSync")
    public BaseOutput upgradeRecordSync(@RequestBody List<UpgradeRecordRequest> upgradeRecordRequest) throws Exception {
        return newEtcAfterSaleService.upgradeRecordSync(upgradeRecordRequest);
    }

    @ApiOperation(value = "OBU检测报告同步", notes = "OBU检测报告同步")
    @LogPointcut(description = "OBU检测报告同步")
    @PostMapping("/checkReportSync")
    public BaseOutput checkReportSync(@RequestBody List<CheckReportRequest> checkReportRequest) throws Exception {
        return newEtcAfterSaleService.checkReportSync(checkReportRequest);
    }

}
